home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -screenplay- / hd_installers / -whdload- / whdload_dev / src / slave-examples / visionmd4.asm < prev    next >
Assembly Source File  |  1998-06-22  |  3KB  |  138 lines

  1. ;*---------------------------------------------------------------------------
  2. ;  :Program.    visionmd4.asm
  3. ;  :Contents.    Slave for "Vision Megademo IV"
  4. ;  :Author.    BJ
  5. ;  :History.    29.09.96
  6. ;        23.03.97 output path changed
  7. ;        24.06.97 keyboard routine fixed
  8. ;        15.08.97 update for key managment
  9. ;        30.08.97 keyboard external
  10. ;  :Requires.    -
  11. ;  :Copyright.    Public Domain
  12. ;  :Language.    68000 Assembler
  13. ;  :Translator.    Barfly V1.131
  14. ;  :To Do.
  15. ;  :Time.    3h 40min
  16. ;---------------------------------------------------------------------------*
  17.  
  18.     INCDIR    Includes:
  19.     INCLUDE    whdload.i
  20.     INCLUDE    graphics/gfxbase.i
  21.     INCLUDE    lvo/exec.i
  22.  
  23.     OUTPUT    "dwart:Vision Megademo IV/visionmd4.slave"
  24.     BOPT    O+ OG+            ;enable optimizing
  25.     BOPT    w4-            ;disable 64k warnings
  26.     SUPER
  27.  
  28. ;======================================================================
  29.  
  30. .base        SLAVE_HEADER        ;ws_Security + ws_ID
  31.         dc.w    4        ;ws_Version
  32.         dc.w    WHDLF_Disk|WHDLF_NoError    ;ws_flags
  33.         dc.l    $80000        ;ws_BaseMemSize    
  34.         dc.l    $400        ;ws_ExecInstall
  35.         dc.w    _Start-.base    ;ws_GameLoader
  36.         dc.w    0        ;ws_CurrentDir
  37.         dc.w    0        ;ws_DontCache
  38. _keydebug    dc.b    $58        ;ws_keydebug = F9
  39. _keyexit    dc.b    $59        ;ws_keyexit = F10
  40.  
  41. ;======================================================================
  42.  
  43.     DOSCMD    "WDate >T:date"
  44.         dc.b    "$VER: WEPL "
  45.     INCBIN    "T:date"
  46.         dc.b    0
  47.  
  48. ;======================================================================
  49. _Start    ;    A0 = resident loader
  50. ;======================================================================
  51.  
  52.         lea    (_resload,pc),a1
  53.         move.l    a0,(a1)            ;save for later use
  54.  
  55.     ;build simple exec=graphics
  56.         lea    $1000,a6    ;execbase/graphicsbase
  57.         move.l    a6,4
  58.         patch    _LVOForbid(a6),.rts
  59.         patch    _LVOPermit(a6),.rts
  60.         patch    _LVOOpenLibrary(a6),.openlibrary
  61.         lea    (-4,a6),a0
  62.         move.l    #-2,(a0)    ;copperlist
  63.         move.l    a0,(gb_copinit,a6)
  64.         bra    .go
  65.  
  66. .openlibrary    move.l    a6,d0
  67. .rts        rts
  68. .go
  69.  
  70.     ;install keyboard quitter
  71.         bsr    _SetupKeyboard
  72.     
  73.     ;bootblock
  74.         moveq    #0,d0        ;offset
  75.         move.l    #2*512,d1    ;size
  76.         moveq    #1,d2        ;disk
  77.         lea    $7f000-$f4-12,a0
  78.         move.l    (_resload),a2
  79.         jsr    (resload_DiskLoad,a2)
  80.         jsr    $7f000
  81.  
  82.         move.l    #$400,d0    ;offset
  83.         move.l    #$f400,d1    ;size
  84.         moveq    #1,d2        ;disk
  85.         lea    $30000,a0    ;dest
  86.         move.l    (_resload),a2
  87.         jsr    (resload_DiskLoad,a2)
  88.         patch    $300ce,.1    ;jmp $1a000
  89.         jmp    $30024        ;decrunch exe
  90. .1
  91.         lea    $1a000,a6
  92.         lea    .dummyint6c,a0
  93.         move.l    a0,$6c
  94.         lea    .dummyint78,a0
  95.         move.l    a0,$78
  96.         move.w    #INTF_SETCLR|INTF_INTEN|INTF_VERTB|INTF_EXTER,_custom+intena
  97.         patch    $1ec(a6),.load
  98.         jmp    $3c(a6)        ;go !
  99.  
  100. .load        move.l    $1a1a8,a0
  101.         move.l    (a0)+,d1    ;size
  102.         move.l    (a0)+,d0    ;offset
  103.         moveq    #1,d2        ;disk
  104.         lea    $2f000,a0    ;dest
  105.         move.l    a1,-(a7)
  106.         move.l    (_resload),a1
  107.         jsr    (resload_DiskLoad,a1)
  108.         move.l    (a7)+,a1
  109.         rts
  110.  
  111. .dummyint6c    move.w    #INTF_VERTB,_custom+intreq
  112.         rte
  113. .dummyint78    move.w    #INTF_EXTER,_custom+intreq
  114.         rte
  115.  
  116. ;--------------------------------
  117.  
  118. _resload    dc.l    0        ;address of resident loader
  119.  
  120. ;--------------------------------
  121.  
  122. _exit        pea    TDREASON_OK.w
  123.         bra    _end
  124. _debug        pea    TDREASON_DEBUG.w
  125. _end        move.l    (_resload),-(a7)
  126.         addq.l    #resload_Abort,(a7)
  127.         rts
  128.  
  129. ;======================================================================
  130.  
  131.     INCDIR    Sources:whdload
  132.     INCLUDE    keyboard.s
  133.  
  134. ;======================================================================
  135.  
  136.     END
  137.  
  138.